<?php
include_once 'Conn.php';
include_once 'Utilitaire.php';
class TopLocation{

	public function listeTopLocation(){
		$bdd = new bdd();
		$requete="SELECT titre,idFilm,resume
				  FROM film
				  WHERE film.idfilm IN (SELECT emprunt.idfilm
									    FROM emprunt
									    group by emprunt.idfilm
					 				    order by count(emprunt.idfilm) desc
					   				    limit 10)";
		$resultatRequete=pg_query($requete);
		$bdd->close();
		return Utilitaire::tableau($resultatRequete);
	}
}
?>

